Skip to content

feat: add QPACK and HTTP/3 frame fuzz targets - #392

Open
Franck-Sorel wants to merge 3 commits into
hyperium:masterfrom
Franck-Sorel:feat/fuzz-qpack-frame
Open

Franck-Sorel wants to merge 3 commits into
hyperium:masterfrom
Franck-Sorel:feat/fuzz-qpack-frame

Conversation

@Franck-Sorel

@Franck-Sorel Franck-Sorel commented Nov 26, 2026 •

Copy link
Copy Markdown

Extends the existing cargo-fuzz setup (which already had fuzz_varint) with three targets (design in docs/FUZZING-PLAN.md):

  • qpack_decode — feeds arbitrary bytes through the QPACK field-section decoder: both the stateless path the connection actually uses (decode_stateless) and the stateful Decoder (on_encoder_recv + decode_header). data[0] is reserved as the split byte so the encoder-instruction setup is decoupled from the field section.
  • frame_parse — decodes a stream of HTTP/3 frames (Frame::<PayloadLen>::decode) from the input, with a zero-consumption guard. Exercises frame type/varint-length/payload parsing and truncation. Note: the frame-ordering rules (DATA-before-HEADERS → H3_FRAME_UNEXPECTED, etc.) live in the connection layer and are not reachable from this isolated codec target; that logic must be covered by tests separately.
  • qpack_encode — synthesizes a HeaderField from the input (name lowercased; empty name/value reachable), encodes it, then round-trips through decode_stateless and asserts the fields match, so an encoder wire-output bug (e.g. the historical name-prefix bit-width error) is caught rather than silently ignored.

Each target has a validated seed corpus. Decoder gets impl Default and a feature-gated re-export so the targets can reach it (default builds stay warning-free).

Requires nightly + cargo-fuzz to run (cargo +nightly fuzz run <target>). Verified on stable via cargo check on the fuzz crate; an actual nightly fuzz campaign should run in CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant